﻿using System.Collections.Generic;

namespace Syngine.Components
{
	/// <summary>
	/// 
	/// </summary>
	public class UpdatableList : UpdatableList<IUpdate>
	{
	}

	/// <summary>
	/// 
	/// </summary>
	/// <typeparam name="T"></typeparam>
	public class UpdatableList<T> : List<T>, IUpdate where T : IUpdate
	{
		public bool IsInitialized { get; private set; }

		public virtual void Initialize()
		{
			IsInitialized = true;
		}

		public virtual void Update(UpdateContext context)
		{
			for (var i = 0; i < Count; i++)
			{
				this[i].Update(context);
			}
		}
	}
}
